// All source files and native code may not be transmitted, reproduced, distributed, 
// or commercially exploited in any way without the express written consent of Sybex Inc.

//MOST THINGS THAT CHANGE

//CHAPTER TITLE
var TestChapter:String = "Chapter 7";

var user_Correct:Array = new Array("B","C","A","C","A","C","B","C","B","B","AC","B","C","AC","A","B","C","A","A","B");

total = user_Correct.length;
_root.countdown = false;
// set to false to make the timer count up //
_root.hour = 0;
// number of hours at start//
_root.minute = 0;
// number of minutes at start//
//DON'T FORGET THE QUESTIONS AT THE END
//END OF MOST THINGS THAT CHANGE
//
//
//The following is used in the timer mc for adjusting the clock.
_root.delay = false;
_root.wait = 60;
//wait in seconds
_root.lastTime = Math.floor(getTimer()/1000);
i = 1;
totalCorrect = 0;
totalWrong = 0;
QCounter.QTotal.text = total;
Test_Title.text = TestChapter;
var finalCorrect:Number;
var userResponse:Array = new Array(total);
var markResponse:Array = new Array(total);
user_responseA = "";
user_responseB = "";
user_responseC = "";
user_responseD = "";
user_responseE = "";
user_responseF = "";
user_responseG = "";
user_responseH = "";
user_responseI = "";
user_responseJ = "";
user_responseK = "";
user_responseL = "";
user_responseM = "";
user_responseN = "";
_root.review = false;

function initialize() {
	_root.review = false;
	for (j=0; j<total; j++) {
		userResponse[j] = "";
		markResponse[j] = "";
	}
	
}

function showMatch() {
	set("user_response"+i, user_responseA+user_responseB+user_responseC+user_responseD+user_responseE+user_responseF+user_responseG+user_responseH+user_responseI+user_responseJ+user_responseK+user_responseL+user_responseM+user_responseN);
	userResponse[i-1] = user_responseA+user_responseB+user_responseC+user_responseD+user_responseE+user_responseF+user_responseG+user_responseH+user_responseI+user_responseJ+user_responseK+user_responseL+user_responseM+user_responseN;
}

// display multiple choice user_response answer function
function display() {
	set("user_response"+i, user_responseA+user_responseB+user_responseC+user_responseD+user_responseE+user_responseF+user_responseG+user_responseH+user_responseI+user_responseJ+user_responseK+user_responseL+user_responseM+user_responseN);
	userResponse[i-1] = user_responseA+user_responseB+user_responseC+user_responseD+user_responseE+user_responseF+user_responseG+user_responseH+user_responseI+user_responseJ+user_responseK+user_responseL+user_responseM+user_responseN;

	//**NEW
	response.text = userResponse[i-1];
	
}

//radio button function
function answer(choice) {
	set("user_response"+i, choice);
	userResponse[i-1] = choice;
	
	//**NEW
	response.text = userResponse[i-1];	
}

// marker button fuction
function mark(choice) {
	_root["mark"+i] = choice;
	markResponse[i-1] = choice;
}

// display fill in the blank by user.
function submit(userInput) {
	_root["user_response"+i] = userInput;
}

function reset() {
	_root["user_response"+i] = "";
}

function UnloadReview() {
	//ReviewLinks.unloadMovie();
}


function LayoutQuestion() {

	qname = "q"+(_root._currentframe-1);
	
	markname = "m"+(_root._currentframe-1);
	
	_root.loadQuestion(_root._currentframe-1);	
	
	_root.createEmptyMovieClip("container", 1);

	_root.attachMovie("Marker_mc", markname, 2, {_x:65.4, _y:55.4});
	
	if (_root.question_type == "2R") { this.attachMovie("2R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "3R") { this.attachMovie("3R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "3MC") { this.attachMovie("3MC", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "4R") { this.attachMovie("4R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "4MC") { this.attachMovie("4MC", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "5R") { this.attachMovie("5R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "5MC") { this.attachMovie("5MC", qname, 1, {_x:24, _y:165}); }	
	if (_root.question_type == "6R") { this.attachMovie("6R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "6MC") { this.attachMovie("6MC", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "7R") { this.attachMovie("7R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "7MC") { this.attachMovie("7MC", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "8R") { this.attachMovie("8R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "8MC") { this.attachMovie("8MC", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "9R") { this.attachMovie("9R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "9MC") { this.attachMovie("9MC", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "10R") { this.attachMovie("10R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "10MC") { this.attachMovie("10MC", qname, 1, {_x:24, _y:165}); }


	if (_root.review == false) { _root.attachMovie("show_answer", "show_answer1", 3, {_x:72, _y:418}); }
	if (_root.review == true)  { _root.attachMovie("show_review", "show_review1", 3, {_x:72, _y:418}); }
        if (_root.figure_flag == "True") { _root.attachMovie("show_figure", "show_figure1", 6, {_x:72, _y:418}); }
        if (_root.figure_flag == "False") { _root.createEmptyMovieClip("container", 6); }        

	question_scroll._visible = (question_text.maxscroll > 1);
	question_scroll.setSize(85,16); 
	
	//**NEW
	response.text = userResponse[i-1];
}

function loadQuestion(inNum:Number) {
	var cur:Number = inNum;
	//This corrects for the first frame holding all functions
	//QUESTIONS AND ANSWERS CAN ACCEPT HTML FORMATTING!!!
	//EACH QUESTION SHOULD BE FORMATTED SIMILAR TO THE FOLLOWING.

	switch (cur) {
case 1 :
_root.question = "When a wireless LAN device listens for beacon frames, it is participating in which phase?";
_root.answerA = "Power save";
_root.answerB = "Passive scanning";
_root.answerC = "Active scanning";
_root.answerD = "Authentication";
_root.correct = "B";
_root.explanation = "When a wireless client device listens for beacons it is performing passive scanning. Active scanning is sending a probe request. Authentication occurs after the probe phase. Power save puts the device into a low power state.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 2 :
_root.question = "You are a sales engineer connected to an IEEE 802.11a access point with a mobile computer. As you move away from the access point, the connection speed slows to the next lowest supported data rate. The change in data rate is described by which term?";
_root.answerA = "Dynamic frequency selection";
_root.answerB = "Transmit power control";
_root.answerC = "Dynamic rate switching";
_root.answerD = "Transmit save mode";
_root.correct = "C";
_root.explanation = "Dynamic rate switching (also called dynamic rate selection) allows a wireless LAN device to adjust data rates based on received signal. Dynamic frequency selection allows an access point to pick the best frequency to operate on based on the environment. Transmit power control automatically adjusts output power. Transmit save mode does not exist.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 3 :
_root.question = "An independent basic service set (IBSS) consists of how many access points?";
_root.answerA = "0";
_root.answerB = "1";
_root.answerC = "2";
_root.answerD = "4";
_root.correct = "A";
_root.explanation = "An IBSS uses no access points and is also known as peer-to-peer or ad hoc networking. A BSS uses one access point.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 4 :
_root.question = "Wireless LAN devices in an 802.11a peer-to-peer network will connect to which device(s)?";
_root.answerA = "An access point";
_root.answerB = "Other 802.11g devices";
_root.answerC = "Other 802.11a devices";
_root.answerD = "A wireless switch";
_root.correct = "C";
_root.explanation = "If a device is part of a peer-to-peer network it will connect to other like devices. An access point and a wireless switch are both infrastructure networking devices and will be part of either a BSS or ESS.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 5 :
_root.question = "As a device moves away from an access point, which of the following is true regarding dynamic rate switching?";
_root.answerA = "Data rate decreases";
_root.answerB = "Output power decreases";
_root.answerC = "Data rate increases";
_root.answerD = "Output power increases";
_root.correct = "A";
_root.explanation = "The data rate decreases as a wireless LAN device moves away from an access point. The data rates increase as a wireless LAN device moves closer to one access point. The output power does not change based upon the location of the wireless device in the radio range of the access point.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 6 :
_root.question = "A service set identifier (SSID) has a maximum limit of how many characters?";
_root.answerA = "8";
_root.answerB = "16";
_root.answerC = "32";
_root.answerD = "128";
_root.correct = "C";
_root.explanation = "An SSID can be a maximum of 32 characters or octets and is also case-sensitive.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 7 :
_root.question = "You are a technical support engineer and receive a call from a customer regarding a problem with their wireless network connection. The building has an ESS network with five 802.11g access points. The customer claims that when they move from their office to a conference room using the 802.11g network, they lose their connection and cannot connect to the access point in the conference room. Which is the most likely cause for this user to lose their connection when they roam on the wireless network?";
_root.answerA = "Different RF channel";
_root.answerB = "Mismatched SSID";
_root.answerC = "Different BSSID";
_root.answerD = "Mismatched association";
_root.correct = "B";
_root.explanation = "If access points on the same distribution system are set with different SSIDs, the client will lose the connection while roaming unless all SSIDs are set in the client utility. The channel is set by the access point and the BSSID is the MAC address of the AP radio.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 8 :
_root.question = "A beacon frame advertises information about the wireless network. A beacon frame is what type of frame?";
_root.answerA = "Data";
_root.answerB = "Control";
_root.answerC = "Management";
_root.answerD = "Detail";
_root.correct = "C";
_root.explanation = "Beacons are management frames and are used in the passive scanning process. Data frames carry data payload. Control frames reserve the medium and acknowledgement frames. Detail frames do not exist.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 9 :
_root.question = "In order for a wireless client to become completely part of the basic service set, it must first _________ then ________.";
_root.answerA = "Associate, authenticate";
_root.answerB = "Authenticate, associate";
_root.answerC = "Deauthenticate, authenticate";
_root.answerD = "Disassociate, authenticate";
_root.correct = "B";
_root.explanation = "The client must authenticate to an access point before it can associate. After both authentication and association have been completed, the client is considered to be part of the BSS.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 10 :
_root.question = "The process in which a wireless LAN clients connection moves from one access point to another is called _____________.";
_root.answerA = "Reauthentication";
_root.answerB = "Roaming";
_root.answerC = "Rebuilding";
_root.answerD = "Roving";
_root.correct = "B";
_root.explanation = "Moving throughout a location will cause a wireless client to roam from one access point to another. As part of the roaming process a client sometimes, but not always, needs to reauthenticate.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 11 :
_root.question = "In order to set up an ad hoc network, a user must know which two parameters? (Choose two.)";
_root.answerA = "SSID";
_root.answerB = "BSSID";
_root.answerC = "Channel";
_root.answerD = "MAC address";
_root.answerE = "Protection mode";
_root.correct = "AC";
_root.explanation = "To successfully set up an ad hoc network, a user must know two parameters, the SSID and the RF channel it will be operating on. The BSSID is automatically generated in an ad hoc network. The BSSID is the MAC address of an AP radio; APs are not used in ad hoc networks. Protection mode does not apply to the situation.";
_root.figure_flag = "False";
_root.question_type = "5MC";
break;

case 12 :
_root.question = "The open system authentication process uses how many frames?";
_root.answerA = "One";
_root.answerB = "Two";
_root.answerC = "Three";
_root.answerD = "Four";
_root.correct = "B";
_root.explanation = "Open system authentication uses two frames. The first frame is from the client to the access point, and the second frame is from the access point back to the client. Shared key authentication uses four frames.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 13 :
_root.question = "You are a help desk support technician at a retail department store, and you receive a call from a manager in the administrative offices. He complains the performance of his 802.11g notebook computer decreases several times throughout the day. Upon visiting the customer, you realize several people are performing inventory using 802.11b barcode scanners in the adjacent room. What is most likely the cause of the poor performance for the managers notebook computer?";
_root.answerA = "Association";
_root.answerB = "Authentication";
_root.answerC = "ERP protection";
_root.answerD = "HT protection";
_root.correct = "C";
_root.explanation = "In 802.11b/g and mixed mode environments, throughput will be affected because of ERP protection mechanisms. Association and authentication are normal frames exchanged and do not affect throughput. HT protection mode is for 802.11n.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 14 :
_root.question = "Which items are unique to a service set identifier (SSID)? (Choose two.)";
_root.answerA = "32 characters maximum";
_root.answerB = "64 characters maximum";
_root.answerC = "Is case sensitive";
_root.answerD = "Is not case sensitive";
_root.correct = "AC";
_root.explanation = "An SSID has a maximum of 32 characters or octets. SSIDs are case-sensitive.";
_root.figure_flag = "False";
_root.question_type = "4MC";
break;

case 15 :
_root.question = "A basic service set identifier (BSSID) is the MAC address of the _________.";
_root.answerA = "AP radio";
_root.answerB = "AP Ethernet port";
_root.answerC = "Router";
_root.answerD = "Client";
_root.correct = "A";
_root.explanation = "The BSSID is the MAC address of the AP radio network adapter. This abbreviation is sometimes confused with SSID, which is a network name. The other MAC addresses are used in networking but are not representative of the BSSID.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 16 :
_root.question = "When an IEEE 802.11g wireless LAN consists only of wireless client stations, the network is operating as what type of basic service set?";
_root.answerA = "Active";
_root.answerB = "Independent";
_root.answerC = "Passive";
_root.answerD = "Infrastructure";
_root.correct = "B";
_root.explanation = "A network consisting only of wireless client stations is an independent basic service set (IBSS). Other terms for this type of network are ad hoc and peer-to-peer. Infrastructure mode is a term used with a basic service set that consists of a single access point. Active and passive are scanning modes in which wireless devices to connect to a wireless network.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 17 :
_root.question = "You are a technical support engineer and provide help desk support for the network in a manufacturing company. You receive a call from the sales manager, who wants to know how power save operations should be set up on her notebook computer to optimize the system performance. The notebook computer is plugged into an AC power source and rarely used on battery. Which mode would you recommend her to set on the wireless adapter?";
_root.answerA = "Power save mode";
_root.answerB = "Association mode";
_root.answerC = "Active mode";
_root.answerD = "Passive mode";
_root.correct = "C";
_root.explanation = "Because the computer is almost always plugged into an AC power source, it is unnecessary to have the device perform power save functions. Therefore active mode (sometimes referred to as continuous aware mode) is the best solution. Power save mode would work well for device that is on battery power and will help extend the battery life. Association and passive mode do not pertain to power save.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 18 :
_root.question = "According to the IEEE 802.11 standard, an extended service set (ESS) consists of how many interconnected basic service sets?";
_root.answerA = "One or more";
_root.answerB = "Two or more";
_root.answerC = "Three or more";
_root.answerD =	"Four or more";
_root.correct = "A";
_root.explanation = "An ESS as stated in the IEEE 802.11 standard is one or more interconnected basic service sets.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 19 :
_root.question = "The association process happens after which phase?";
_root.answerA = "Authentication";
_root.answerB = "Distribution";
_root.answerC = "Deauthentication";
_root.answerD = "Reauthentication";
_root.correct = "A";
_root.explanation = "In order for a wireless client to become part of a basic service set it must first authenticate, then associate. The distribution system is the network in which the access point is physically connected. Deauthentication and reauthentication occur when a client either logs off the wireless network or roams from one access point to another.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 20 :
_root.question = "A basic service set (BSS) consists of how many access points?";
_root.answerA = "0";
_root.answerB = "1";
_root.answerC = "2";
_root.answerD = "4";
_root.correct = "B";
_root.explanation = "A BSS consists of only one access point. An IBSS has zero access points. A network with more than one access point would be considered an ESS.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

	}
		
	QCounter.QCurrent.text = cur;
}

initialize();


//Change the following question numbers to the indicated question type!
//1. 4R
//2. 4R
//3. 4R
//4. 4R
//5. 4R
//6. 4R
//7. 4R
//8. 4R
//9. 4R
//10. 4R
//11. 5MC
//12. 4R
//13. 4R
//14. 4MC
//15. 4R
//16. 4R
//17. 4R
//18. 3R
//19. 4R
//20. 4R





//